<div class="moduleTips">
    <img alt="moduleTips" src="http://juke.ipropre.com/public/uploads/moduleTips.png">
    <span>【小提示】:</span> 您可以创建分组，并把旺旺按照分组来管理。
</div>

<div class="syncww">
    管理子帐号，请从这里进入:
    <a href="http://mai.taobao.com/seller_admin.htm?svid=1501" target="_blank" title="进入子帐号管理"> &gt;&gt;进入子帐号管理</a>
</div>

<div class="step catsManage">
    <h3 class="step_hd">分组管理</h3>
    <div class="step_bd" style="display:block;">

        <dl>
            
            <?php
            foreach ($grouparray as $kwy => $val) {
               
                $url= site_url("wangwangmag/delgroup/{$val["id"]}");
                echo "  <dd><span class=\"gname\">{$val["groupname"]}</span> <a href=\"{$url}\" title=\"删除\">删除</a> | <a href=\"#\" title=\"修改\" class=\"gEdit\" g-id=\"{$val["id"]}\">修改</a></dd>
              ";
            }
            ?>
            <dt><input type="button" value="添加分组" id="addWwGroup" /></dt>
        </dl>
        <script type="text/javascript">
            jQuery(function(){
                jQuery("#addWwGroup").colorbox({inline:true,width:'360px',href:'#addWwGroupForm'});
                jQuery("a.gEdit").colorbox({
                    inline:true,width:'360px',href:'#editWwGroupForm',onOpen:function(){
                        jQuery('#editWwGroupForm input[name="groupName"]').val(jQuery(this).siblings('.gname').eq(0).html());
                        jQuery('#editWwGroupForm input[name="groupId"]').val(jQuery(this).attr('g-id'));
                    }
                });
					
            });
        </script>
        <div style="display:none;">
            <!-- 添加分组 -->
            <form method="post" action="<?php
            echo site_url("wangwangmag/savegroup");
            
            ?>" id="addWwGroupForm">
                <h3>添加旺旺分组</h3>
                分组名称: <input type="text" name="groupName" size="15" />
                <input type="submit" value="添加分组" name="addWwGroupSubmit" />
            </form>
            <!-- 修改分组名称 -->
            <form method="post" action="<?php
            echo site_url("wangwangmag/updategroup");
            
            ?>" id="editWwGroupForm">
                <h3>请输入新的分组名称</h3>
                <input type="text" name="groupName" size="18" />
                <input type="hidden" name="groupId" value="" />
                <input type="submit" value="修改分组" name="editWwGroupSubmit" />
            </form>
        </div>

<?php
//print_r($resp);
//print_r($subnicks);
//print_r($role_id_nick);
?>

    </div>
</div>


<div class="step wwManage">
    <h3 class="step_hd">旺旺帐号管理</h3>
    <div class="step_bd" style="display:block;">

        <div class="wwAdd"><form action="<?php
        
       echo site_url("wangwangmag/saveclient");
        ?>" method="post">
            把帐号: <?php //echo form_dropdown('nicks', $nicks, 0); ?>
            <select name="nicks">
<?php
//if (isset($clientsarray[1])) {
//    echo " <option selected value=\"0\">{$_SESSION["usernick"]}</option>";
//    foreach ($clientsarray as $key => $val) {
//        echo "<option  value=\"{$val["sub_id"]}\">{$val["nick"]}</option>";
//    }
//} else {
//    
//}
if($clientsarray){ foreach ($clientsarray as $key => $val){
     
     echo "<option  value=\"{$val["subid"]}\">{$val["nicekname"]}</option>";
     
     
     
     
 }}




?>
            </select>

            添加到分组:<select name="group"> <?php //echo form_dropdown('wwGroup', $wwGroup, 0); 
          foreach($grouparray as $key=>$val){
              
              echo "<option value=\"{$val["roleid"]}\">{$val["groupname"]}</option>";
              
          }  
            
            
            
            ?> </select > 
            
            <input type="submit" value="添加"  <?php
            if(empty($grouparray))
            {echo "disabled";}
            ?>/></form>
        </div>

        <dl>
            <?php
            foreach($grouparray as $key=>$val){
                
                echo "<dt>{$val["groupname"]}</dt>";
                foreach($sellerinfo as $k=>$v ){
                    
                  if($v["roleid"]==$val["roleid"]){
                      $url= site_url("wangwangmag/delclient/{$v["id"]}");;
                      echo "<dd><span class=\"nick\">{$v["nicekname"]} <a target=\"_blank\" href=\"http://www.taobao.com/webww/ww.php?ver=3&touid='.$v.'&siteid=cntaobao&status=1&charset=utf-8\"><img border=\"0\" src=\"http://amos.alicdn.com/online.aw?v=2&uid={$v["nicekname"]}&site=cntaobao&s=1&charset=utf-8\" alt=\"点这里给我发消息\" /></a></span> <a href=\"{$url}\" title=\"删除\">删除</a></dd>";
                      
                  }  
                    
                }
            }
            
            ?>
            
            
           
        </dl>

    </div>
</div>


<input type="hidden" value="wwset" id="moduleType" />